package com.macro.mall.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 仪表盘统计数据传输对象
 * Created by macro on 2023/6/15.
 */
@Data
public class DashboardStatisticsDTO {

    @ApiModelProperty("总体统计信息")
    private TotalStatistics totalStatistics;

    @ApiModelProperty("待处理事务")
    private PendingTasks pendingTasks;

    @ApiModelProperty("商品概览")
    private ProductOverview productOverview;

    @ApiModelProperty("用户概览")
    private UserOverview userOverview;

    @ApiModelProperty("订单统计")
    private OrderStatistics orderStatistics;

    @Data
    public static class TotalStatistics {
        @ApiModelProperty("今日订单总数")
        private Integer todayOrderCount;

        @ApiModelProperty("今日销售总额")
        private BigDecimal todaySalesAmount;

        @ApiModelProperty("昨日销售总额")
        private BigDecimal yesterdaySalesAmount;
    }

    @Data
    public static class PendingTasks {
        @ApiModelProperty("待付款订单数")
        private Integer unpaidOrderCount;

        @ApiModelProperty("已完成订单数")
        private Integer completedOrderCount;

        @ApiModelProperty("待确认收货订单数")
        private Integer pendingReceiveOrderCount;

        @ApiModelProperty("待发货订单数")
        private Integer pendingDeliveryOrderCount;

        @ApiModelProperty("新缺货登记数")
        private Integer newOutOfStockCount;

        @ApiModelProperty("待处理退款数")
        private Integer pendingRefundCount;

        @ApiModelProperty("已发货订单数")
        private Integer deliveredOrderCount;

        @ApiModelProperty("待处理退货数")
        private Integer pendingReturnCount;

        @ApiModelProperty("即将到期广告数")
        private Integer expiringAdsCount;
    }

    @Data
    public static class ProductOverview {
        @ApiModelProperty("已下架商品数量")
        private Integer offShelfCount;

        @ApiModelProperty("已上架商品数量")
        private Integer onShelfCount;

        @ApiModelProperty("库存紧张商品数量")
        private Integer lowStockCount;

        @ApiModelProperty("商品总数")
        private Integer totalCount;
    }

    @Data
    public static class UserOverview {
        @ApiModelProperty("今日新增用户数")
        private Integer todayNewCount;

        @ApiModelProperty("昨日新增用户数")
        private Integer yesterdayNewCount;

        @ApiModelProperty("本月新增用户数")
        private Integer monthNewCount;

        @ApiModelProperty("用户总数")
        private Integer totalCount;
    }

    @Data
    public static class OrderStatistics {
        @ApiModelProperty("本月订单总数")
        private Integer monthOrderCount;

        @ApiModelProperty("本月订单总数同比增长")
        private Integer monthOrderCountGrowth;

        @ApiModelProperty("本周订单总数")
        private Integer weekOrderCount;

        @ApiModelProperty("本周订单总数环比增长")
        private Integer weekOrderCountGrowth;

        @ApiModelProperty("本月销售总额")
        private BigDecimal monthSalesAmount;

        @ApiModelProperty("本月销售总额同比增长")
        private Integer monthSalesAmountGrowth;

        @ApiModelProperty("本周销售总额")
        private BigDecimal weekSalesAmount;

        @ApiModelProperty("本周销售总额环比增长")
        private Integer weekSalesAmountGrowth;
    }
} 